<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>邮件设置 - 拖拽式建站平台</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }

        :root {
            --sidebar-width: 240px;
            --header-height: 64px;
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --bg-color: #f5f6f7;
            --card-bg: #ffffff;
            --text-primary: #18191c;
            --text-secondary: #61666d;
            --text-muted: #9499a0;
            --border-color: #e3e5e7;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        /* 顶部导航栏 */
        .header {
            height: var(--header-height);
            background: var(--card-bg);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            border-bottom: 1px solid var(--border-color);
            z-index: 100;
        }

        .header-left {
            display: flex;
            align-items: center;
        }

        .sidebar-toggle {
            margin-right: 16px;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 18px;
        }

        .logo {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }

        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }

        .header-right {
            display: flex;
            align-items: center;
        }

        .header-action {
            margin-left: 16px;
            color: var(--text-secondary);
            cursor: pointer;
            position: relative;
        }

        .header-action:hover {
            color: var(--primary-color);
        }

        .badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background: var(--danger-color);
            color: white;
            font-size: 11px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .user-menu {
            display: flex;
            align-items: center;
            margin-left: 20px;
            cursor: pointer;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 12px;
        }

        /* 主内容区域 */
        .main-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        /* 侧边栏 */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--card-bg);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            transition: all 0.3s ease;
        }

        .sidebar-menu {
            padding: 16px 0;
        }

        .menu-title {
            padding: 10px 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .menu-item {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .menu-item:hover {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }

        .menu-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .menu-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 内容区域 */
        .content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
        }

        .page-actions .btn {
            margin-left: 10px;
        }

        /* 设置区域 */
        .settings-container {
            display: flex;
            flex: 1;
            gap: 20px;
        }

        /* 设置侧边导航 */
        .settings-nav {
            width: 240px;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            flex-shrink: 0;
        }

        .nav-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-color);
            font-weight: 500;
            color: var(--text-primary);
        }

        .nav-items {
            padding: 8px 0;
        }

        .nav-item {
            padding: 12px 20px;
            display: flex;
            align-items: center;
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .nav-item:hover {
            background: rgba(52, 152, 219, 0.05);
            color: var(--primary-color);
        }

        .nav-item.active {
            background: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left-color: var(--primary-color);
        }

        .nav-item i {
            margin-right: 12px;
            width: 18px;
            text-align: center;
        }

        /* 设置内容区域 */
        .settings-content {
            flex: 1;
            background: var(--card-bg);
            border-radius: 4px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            display: flex;
            flex-direction: column;
        }

        .content-header {
            padding: 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .content-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .content-description {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .content-body {
            padding: 20px;
            flex: 1;
            overflow-y: auto;
        }

        .settings-section {
            margin-bottom: 32px;
        }

        .section-title {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 16px;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
        }

        .section-title i {
            margin-right: 8px;
            color: var(--primary-color);
        }

        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            font-weight: 500;
        }

        .form-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        .form-textarea {
            min-height: 100px;
            resize: vertical;
        }

        .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            background: white;
            font-size: 14px;
        }

        .form-check {
            display: flex;
            align-items: center;
        }

        .form-check-input {
            margin-right: 8px;
        }

        .form-check-label {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .form-row {
            display: flex;
            gap: 16px;
        }

        .form-col {
            flex: 1;
        }

        .test-email-form {
            background: #f9fafc;
            border-radius: 4px;
            padding: 16px;
            margin-top: 16px;
        }

        .template-tabs {
            display: flex;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 16px;
        }

        .template-tab {
            padding: 8px 16px;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.3s ease;
        }

        .template-tab.active {
            border-bottom-color: var(--primary-color);
            color: var(--primary-color);
            font-weight: 500;
        }

        .template-content {
            display: none;
        }

        .template-content.active {
            display: block;
        }

        .template-variables {
            background: #f5f7fa;
            border-radius: 4px;
            padding: 12px;
            margin-bottom: 16px;
        }

        .variable-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .variable-item {
            background: #e8f4ff;
            padding: 4px 8px;
            border-radius: 3px;
            font-size: 12px;
            color: var(--primary-color);
        }

        .content-footer {
            padding: 20px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        /* 按钮样式 */
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .btn i {
            margin-right: 6px;
        }

        .btn-primary {
            background: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background: #2980b9;
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
        }

        .btn-outline:hover {
            background: #f5f7fa;
        }

        .btn-success {
            background: var(--success-color);
            color: white;
        }

        .btn-success:hover {
            background: #219653;
        }

        .btn-danger {
            background: var(--danger-color);
            color: white;
        }

        .btn-danger:hover {
            background: #c0392b;
        }

        .btn-sm {
            padding: 6px 12px;
            font-size: 13px;
        }

        /* 状态提示 */
        .status-message {
            padding: 8px 12px;
            border-radius: 4px;
            margin-bottom: 16px;
            display: none;
        }

        .status-success {
            background: rgba(39, 174, 96, 0.1);
            color: var(--success-color);
            border: 1px solid rgba(39, 174, 96, 0.2);
        }

        .status-error {
            background: rgba(231, 76, 60, 0.1);
            color: var(--danger-color);
            border: 1px solid rgba(231, 76, 60, 0.2);
        }

        /* 响应式设计 */
        @media (max-width: 992px) {
            .settings-container {
                flex-direction: column;
            }

            .settings-nav {
                width: 100%;
            }

            .sidebar {
                position: fixed;
                left: -var(--sidebar-width);
                top: var(--header-height);
                bottom: 0;
                z-index: 90;
            }

            .sidebar.open {
                left: 0;
            }

            .overlay {
                position: fixed;
                top: var(--header-height);
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 80;
                display: none;
            }

            .overlay.open {
                display: block;
            }
        }

        @media (max-width: 768px) {
            .form-row {
                flex-direction: column;
                gap: 0;
            }

            .page-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .page-actions {
                margin-top: 16px;
                width: 100%;
                display: flex;
                justify-content: space-between;
            }

            .page-actions .btn {
                margin-left: 0;
                flex: 1;
                margin: 0 5px;
            }
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <div class="header">
        <div class="header-left">
            <div class="sidebar-toggle">
                <i class="fas fa-bars"></i>
            </div>
            <div class="logo">
                <i class="fas fa-puzzle-piece"></i>
                拖拽建站后台
            </div>
        </div>

        <div class="header-right">
            <div class="header-action">
                <i class="fas fa-bell"></i>
                <span class="badge">3</span>
            </div>

            <div class="header-action">
                <i class="fas fa-envelope"></i>
                <span class="badge">5</span>
            </div>

            <div class="user-menu">
                <span>管理员</span>
                <div class="user-avatar">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- 主内容区域 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-menu">
                <div class="menu-title">主导航</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-home"></i>
                    <span>控制台</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-paint-brush"></i>
                    <span>网站管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-file-alt"></i>
                    <span>页面管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-th-large"></i>
                    <span>组件库</span>
                </a>

                <div class="menu-title">内容管理</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-newspaper"></i>
                    <span>文章管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-box"></i>
                    <span>产品管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-images"></i>
                    <span>媒体库</span>
                </a>

                <div class="menu-title">用户与权限</div>
                <a href="#" class="menu-item">
                    <i class="fas fa-users"></i>
                    <span>用户管理</span>
                </a>
                <a href="#" class="menu-item">
                    <i class="fas fa-shield-alt"></i>
                    <span>角色权限</span>
                </a>
                <a href="#" class="menu-item active">
                    <i class="fas fa-cog"></i>
                    <span>系统设置</span>
                </a>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">
            <div class="page-header">
                <h1 class="page-title">系统设置</h1>
                <div class="page-actions">
                    <button class="btn btn-outline">
                        <i class="fas fa-history"></i> 恢复默认
                    </button>
                    <button class="btn btn-primary" id="saveSettings">
                        <i class="fas fa-save"></i> 保存设置
                    </button>
                </div>
            </div>

            <!-- 设置区域 -->
            <div class="settings-container">
                <!-- 设置导航 -->
                <div class="settings-nav">
                    <div class="nav-header">设置分类</div>
                    <div class="nav-items">
                        <a href="#" class="nav-item">
                            <i class="fas fa-globe"></i>
                            <span>基本设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-lock"></i>
                            <span>安全设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-paint-brush"></i>
                            <span>外观设置</span>
                        </a>
                        <a href="#" class="nav-item active">
                            <i class="fas fa-envelope"></i>
                            <span>邮件设置</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-database"></i>
                            <span>数据管理</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-plug"></i>
                            <span>第三方服务</span>
                        </a>
                        <a href="#" class="nav-item">
                            <i class="fas fa-code"></i>
                            <span>自定义代码</span>
                        </a>
                    </div>
                </div>

                <!-- 设置内容 -->
                <div class="settings-content">
                    <div class="content-header">
                        <div class="content-title">邮件设置</div>
                        <div class="content-description">配置系统邮件服务器和邮件模板</div>
                    </div>

                    <div class="content-body">
                        <div id="statusMessage" class="status-message"></div>

                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-server"></i>
                                SMTP服务器配置
                            </div>

                            <div class="form-row">
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">SMTP服务器地址</label>
                                        <input type="text" class="form-input" id="smtpHost" value="smtp.example.com">
                                    </div>
                                </div>
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">端口</label>
                                        <input type="number" class="form-input" id="smtpPort" value="587">
                                    </div>
                                </div>
                            </div>

                            <div class="form-row">
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">加密方式</label>
                                        <select class="form-select" id="smtpEncryption">
                                            <option value="none">无</option>
                                            <option value="ssl" selected>SSL</option>
                                            <option value="tls">TLS</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">超时时间(秒)</label>
                                        <input type="number" class="form-input" id="smtpTimeout" value="30">
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="smtpAuth" checked>
                                    <label class="form-check-label" for="smtpAuth">需要身份验证</label>
                                </div>
                            </div>

                            <div class="form-row">
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">用户名</label>
                                        <input type="text" class="form-input" id="smtpUsername"
                                            value="your-email@example.com">
                                    </div>
                                </div>
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">密码</label>
                                        <input type="password" class="form-input" id="smtpPassword" value="">
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <button class="btn btn-outline" id="testSmtp">
                                    <i class="fas fa-plug"></i> 测试连接
                                </button>
                            </div>
                        </div>

                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-user"></i>
                                发件人设置
                            </div>

                            <div class="form-row">
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">发件人名称</label>
                                        <input type="text" class="form-input" id="senderName" value="系统管理员">
                                    </div>
                                </div>
                                <div class="form-col">
                                    <div class="form-group">
                                        <label class="form-label">发件人邮箱</label>
                                        <input type="email" class="form-input" id="senderEmail"
                                            value="noreply@example.com">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-envelope"></i>
                                邮件模板
                            </div>

                            <div class="template-tabs">
                                <div class="template-tab active" data-template="welcome">欢迎邮件</div>
                                <div class="template-tab" data-template="reset">密码重置</div>
                                <div class="template-tab" data-template="notification">通知邮件</div>
                            </div>

                            <div class="template-content active" id="welcome-template">
                                <div class="form-group">
                                    <label class="form-label">邮件主题</label>
                                    <input type="text" class="form-input" value="欢迎加入我们！">
                                </div>

                                <div class="form-group">
                                    <label class="form-label">邮件内容</label>
                                    <textarea
                                        class="form-input form-textarea">尊敬的{username}，欢迎您加入我们！感谢您注册我们的服务。</textarea>
                                </div>

                                <div class="template-variables">
                                    <div class="form-label">可用变量</div>
                                    <div class="variable-list">
                                        <span class="variable-item">{username}</span>
                                        <span class="variable-item">{email}</span>
                                        <span class="variable-item">{sitename}</span>
                                        <span class="variable-item">{date}</span>
                                    </div>
                                </div>
                            </div>

                            <div class="template-content" id="reset-template">
                                <div class="form-group">
                                    <label class="form-label">邮件主题</label>
                                    <input type="text" class="form-input" value="重置您的密码">
                                </div>

                                <div class="form-group">
                                    <label class="form-label">邮件内容</label>
                                    <textarea
                                        class="form-input form-textarea">您好{username}，我们收到了您重置密码的请求。请点击以下链接重置密码：{reset_link}</textarea>
                                </div>

                                <div class="template-variables">
                                    <div class="form-label">可用变量</div>
                                    <div class="variable-list">
                                        <span class="variable-item">{username}</span>
                                        <span class="variable-item">{email}</span>
                                        <span class="variable-item">{reset_link}</span>
                                        <span class="variable-item">{sitename}</span>
                                    </div>
                                </div>
                            </div>

                            <div class="template-content" id="notification-template">
                                <div class="form-group">
                                    <label class="form-label">邮件主题</label>
                                    <input type="text" class="form-input" value="系统通知">
                                </div>

                                <div class="form-group">
                                    <label class="form-label">邮件内容</label>
                                    <textarea
                                        class="form-input form-textarea">尊敬的{username}，您有一个新的系统通知：{message}</textarea>
                                </div>

                                <div class="template-variables">
                                    <div class="form-label">可用变量</div>
                                    <div class="variable-list">
                                        <span class="variable-item">{username}</span>
                                        <span class="variable-item">{email}</span>
                                        <span class="variable-item">{message}</span>
                                        <span class="variable-item">{sitename}</span>
                                        <span class="variable-item">{date}</span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="settings-section">
                            <div class="section-title">
                                <i class="fas fa-paper-plane"></i>
                                测试邮件发送
                            </div>

                            <div class="test-email-form">
                                <div class="form-group">
                                    <label class="form-label">测试邮箱地址</label>
                                    <input type="email" class="form-input" id="testEmail" placeholder="输入接收测试邮件的邮箱地址">
                                </div>

                                <div class="form-group">
                                    <button class="btn btn-outline" id="sendTestEmail">
                                        <i class="fas fa-paper-plane"></i> 发送测试邮件
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="content-footer">
                        <button class="btn btn-outline">
                            <i class="fas fa-times"></i> 取消
                        </button>
                        <button class="btn btn-primary" id="saveEmailSettings">
                            <i class="fas fa-save"></i> 保存邮件设置
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 移动端遮罩层 -->
    <div class="overlay"></div>

    <script>
        document.addEventListener('DOMContentLoaded', function () {
            // 侧边栏切换
            const sidebarToggle = document.querySelector('.sidebar-toggle');
            const sidebar = document.querySelector('.sidebar');
            const overlay = document.querySelector('.overlay');

            sidebarToggle.addEventListener('click', function () {
                sidebar.classList.toggle('open');
                overlay.classList.toggle('open');
            });

            overlay.addEventListener('click', function () {
                sidebar.classList.remove('open');
                overlay.classList.remove('open');
            });

            // 设置导航项点击
            const navItems = document.querySelectorAll('.nav-item');

            navItems.forEach(item => {
                item.addEventListener('click', function (e) {
                    e.preventDefault();
                    navItems.forEach(i => i.classList.remove('active'));
                    this.classList.add('active');

                    // 这里可以添加加载对应设置内容的代码
                    const tabName = this.querySelector('span').textContent;
                    document.querySelector('.content-title').textContent = tabName;
                    console.log('切换到设置: ' + tabName);
                });
            });

            // 邮件模板选项卡切换
            const templateTabs = document.querySelectorAll('.template-tab');
            const templateContents = document.querySelectorAll('.template-content');

            templateTabs.forEach(tab => {
                tab.addEventListener('click', function () {
                    const templateType = this.getAttribute('data-template');

                    // 切换选项卡激活状态
                    templateTabs.forEach(t => t.classList.remove('active'));
                    this.classList.add('active');

                    // 切换内容显示
                    templateContents.forEach(content => {
                        content.classList.remove('active');
                        if (content.id === `${templateType}-template`) {
                            content.classList.add('active');
                        }
                    });
                });
            });

            // 测试SMTP连接
            const testSmtpBtn = document.getElementById('testSmtp');
            const statusMessage = document.getElementById('statusMessage');

            testSmtpBtn.addEventListener('click', function () {
                const host = document.getElementById('smtpHost').value;
                const port = document.getElementById('smtpPort').value;

                // 模拟测试连接
                statusMessage.textContent = `正在测试连接到 ${host}:${port}...`;
                statusMessage.className = 'status-message status-success';
                statusMessage.style.display = 'block';

                setTimeout(() => {
                    statusMessage.textContent = '连接测试成功！SMTP服务器配置正确。';
                    statusMessage.className = 'status-message status-success';
                }, 1500);
            });

            // 发送测试邮件
            const sendTestEmailBtn = document.getElementById('sendTestEmail');

            sendTestEmailBtn.addEventListener('click', function () {
                const testEmail = document.getElementById('testEmail').value;

                if (!testEmail) {
                    statusMessage.textContent = '请输入测试邮箱地址';
                    statusMessage.className = 'status-message status-error';
                    statusMessage.style.display = 'block';
                    return;
                }

                // 模拟发送测试邮件
                statusMessage.textContent = `正在发送测试邮件到 ${testEmail}...`;
                statusMessage.className = 'status-message status-success';
                statusMessage.style.display = 'block';

                setTimeout(() => {
                    statusMessage.textContent = `测试邮件已发送到 ${testEmail}，请查收。`;
                    statusMessage.className = 'status-message status-success';
                }, 1500);
            });

            // 保存邮件设置
            const saveEmailSettingsBtn = document.getElementById('saveEmailSettings');

            saveEmailSettingsBtn.addEventListener('click', function () {
                // 模拟保存设置
                statusMessage.textContent = '正在保存邮件设置...';
                statusMessage.className = 'status-message status-success';
                statusMessage.style.display = 'block';

                setTimeout(() => {
                    statusMessage.textContent = '邮件设置已成功保存！';
                    statusMessage.className = 'status-message status-success';
                }, 1000);
            });
        });
    </script>
</body>

</html>